package com.wcs.exam.controller.admin.resp;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serial;
import java.io.Serializable;
import java.util.List;

/**
 * <p>
 * Admin-试题信息-上传解析-响应对象
 * </p>
 *
 * @author wcs
 * @since 2025-03-11
 */
@Getter
@Setter
@Accessors(chain = true)
@Schema(description = "Admin-试题信息-上传解析-响应对象")
public class AdminQuestionUploadParseResp implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "文件名称")
    private String fileName;

    @Schema(description = "上传Token")
    private String uploadToken;

    @Schema(description = "过期时间(单位：秒)")
    private Integer timeout;

    @Schema(description = "错误信息集合")
    private List<String> errorMessages;

    @Schema(description = "成功数")
    private Integer successCount;

    @Schema(description = "失败数")
    private Integer errorCount;

    @Schema(description = "重复信息")
    private List<DuplicationInfo> duplicationInfos;

    @Data
    @Schema(name = "AdminQuestionUploadParseResp.DuplicationInfo", description = "Admin-试题信息-上传解析-重复信息-响应对象")
    public static class DuplicationInfo implements Serializable {

        @Serial
        private static final long serialVersionUID = -8421877175969248132L;

        @Schema(description = "行号")
        private Integer rowNo;

        @Schema(description = "题目类型(1:单选题、2:多选题、3:判断题、4:填空题、5:简答题)")
        private Integer questionType;

        @Schema(description = "题目内容")
        private String questionTitle;

        @Schema(description = "重复数")
        private Integer duplicationCount;

        @Schema(description = "题目信息")
        private List<Question> questions;
    }

    @Data
    @Accessors(chain = true)
    @Schema(name = "AdminQuestionUploadParseResp.Question", description = "Admin-试题信息-上传解析-题目信息-响应对象")
    public static class Question implements Serializable {

        @Serial
        private static final long serialVersionUID = -7751337624526037326L;

        @Schema(description = "是否存在(false:不存在题目-表示为导入文件中题目、true:在平台中存在)")
        private Boolean exist;

        @Schema(description = "主键ID")
        private Long id;

        @Schema(description = "分类ID")
        private Long categoryId;

        @Schema(description = "分类名称")
        private String categoryName;

        @Schema(description = "题目类型(1:单选题、2:多选题、3:判断题、4:填空题、5:简答题)")
        private Integer questionType;

        @Schema(description = "难度等级(1:简单、2:一般、3:困难)")
        private Integer difficultyLevel;

        @Schema(description = "题目内容")
        private String questionTitle;

        @Schema(description = "行号")
        private Integer rowNo;
    }
}
